<%@ page contentType="text/html; charset=UTF-8"%>
<!-- Page Start! --> 
<SCRIPT LANGUAGE="JavaScript">
// 翻页
function pageJump4Paging(key, v){
	var url=window.location.href.replace(/\#+$/,"");
	var reg=new RegExp("^\\d+$");
	
	if (key && reg.test(v)){//key不可为空，v必须为数字
		 document.pagingFrom.action=setQueryString4Paging(url, key, v);
		 document.pagingFrom.target="";
		 document.pagingFrom.submit();
	}else{
		alert("请输入数字作为页码！");
	}
}

// 获取一个查询键值
function getQueryString4Paging(url, key){
	if (!key) return url;

	var re = new RegExp("((?:.*)(?:^|&|\\?)"+key+"=)([^&#]*)(.+|$)");
	var mt = url.match(re);
	if (mt != null && mt.length>2)
		return unescape(mt[2]);
	else
		return null;
}

// 设入一个查询键值
function setQueryString4Paging(url, key, v){
	if (!key) return url;
	
	v = escape(escape(v));
	
	var re = new RegExp("((?:.*)(?:^|&|\\?)"+key+"=)([^&#]*)(.+|$)");
	var re_qm = new RegExp("\\?", "ig");
	
	if (re.test(url))
		url=url.replace(re, "$1"+v+"$3");
	else if (re_qm.test(url))
		url=url+"&"+key+"="+v;
	else
		url=url+"?"+key+"="+v;
	return url;
}
</SCRIPT>

<!--
************************************************************
** 需要地址栏接受型如PAGE=xx的参数
** 当地址栏包含型如IOS=x的参数时，采用文本框方式，否则采用下拉框方式
************************************************************
-->

<form method="post" id="pagingFrom" target="_self" name="pagingFrom" action="#">
	<c:if test="${PAGEPARAM!=null}">
		<c:forEach items="${PAGEPARAM}" var="entry">
			<c:if test="${entry.value!=null}">
				<input type="hidden" id="<c:out value="${entry.key}" />" name="<c:out value="${entry.key}" />" value="<c:out value="${entry.value}" />"/>
			</c:if>
		</c:forEach>
	</c:if>
</form>
<!-- 记录数统计 -->
共<c:out value="${PAGEINFO.total}" />条记录

第<c:out value="${PAGEINFO.curPage}"/>/<c:out value="${PAGEINFO.totalPage}"/>页

	<!-- 超链接 "上一页 下一页" -->
	<c:if test="${PAGEINFO.curPage == 1}">首页</c:if>
	<c:if test="${PAGEINFO.curPage > 1}">
	<a href="#" onClick="pageJump4Paging('dataBean.curPage', 1);return false;">首页</a>
	</c:if>
	<c:if test="${PAGEINFO.curPage > 1}">
		<a href="#" onClick="pageJump4Paging('dataBean.curPage', <c:out value="${PAGEINFO.curPage-1}"/>);return false;">上一页</a>
	</c:if>
	
	<c:if test="${PAGEINFO.curPage == 1}">上一页</c:if>
	
	<c:if test="${PAGEINFO.curPage < PAGEINFO.totalPage}">
		<a href="#" onClick="pageJump4Paging('dataBean.curPage',  <c:out value="${PAGEINFO.curPage+1}"/>);return false;">下一页</a>
	</c:if>
	
	<c:if test="${PAGEINFO.curPage == PAGEINFO.totalPage}">下一页</c:if>
	<c:if test="${PAGEINFO.curPage < PAGEINFO.totalPage}">
	<a href="#" onClick="pageJump4Paging('dataBean.curPage', <c:out value="${PAGEINFO.totalPage}"/>);return false;">尾页</a>
	</c:if>
	<c:if test="${PAGEINFO.curPage == PAGEINFO.totalPage}">尾页</c:if>
	<c:choose>
		<c:when test="${empty param.IOS}">
			<!-- 下拉页面表单v -->
			跳转到
			<select id="PAGE_SELECT" style="width:90px" onChange="pageJump4Paging('dataBean.curPage', this.value)">
			<c:forEach var="pg" step="1" begin="1" end="${PAGEINFO.totalPage}">
				<option value="${pg}" <c:if test="${pg == PAGEINFO.curPage}">selected="selected"</c:if> >
					第<c:out value="${pg}"/>页
				</option>
			</c:forEach>
			</select>
		</c:when>
		<c:otherwise>
			<!-- 文本框v -->
			第
			<input type="text" id="PAGE_INPUT" style="border: #b2b2b2 1px solid; height: 16px" size="2" maxlength="4" value="<c:out value="${PAGEINFO.curPage}"/>"
			 onkeypress="if (event.keyCode==13) pageJump4Paging('dataBean.curPage', this.value);return false;">
			页
			<A HREF="#" style="font-family:Arial, Courier New" onclick="pageJump4Paging('dataBean.curPage', document.getElementById('PAGE_INPUT').value);">GO</A>>>
		</c:otherwise>
	</c:choose>
<!-- Page End! -->
